package com.easy.interceptor;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.BufferedReader;

@Component
public class PrivateInformationInterceptor implements HandlerInterceptor {

    public static final String PHONE_REGEX = "^\\d{11}$"; // 简单的手机号正则表达式，实际可能更复杂
    public static final String EMAIL_REGEX = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$";
    public static final String ID_NUMBER_REGEX = "^\\d{15}|\\d{18}$"; // 简单的身份证号正则表达式，实际可能更复杂
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        return true;
    }
}
